package Week3.J0503;

// 滑动窗口?

import Week3.J0430.乒乓球筐_xv;

import java.util.Scanner;

public class 比那名居的桃子_xv {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int dur = scanner.nextInt();
        long[] happy = new long[n+1];
        long[] shame = new long[n+1];
        long cntH = 0;
        long tmpH = 0;
        long cntS = Integer.MAX_VALUE;
        long tmpS = 0;
        int left = 1;
        int right = 1;
        int pos = 0;

        for (int i = 1; i <= n; i++) {
            happy[i] = scanner.nextLong();
        }
        for (int i = 1; i <= n; i++) {
            shame[i] = scanner.nextLong();
        }

        while (right <= n) {
            tmpH += happy[right];
            tmpS += shame[right];

            while (right - left + 1 > dur) {
                tmpH -= happy[left];
                tmpS -= shame[left];
                left++;
            }
            if (right - left + 1 == dur) {
                if (tmpH > cntH) {
                    pos = left;
                    cntH = tmpH;
                    cntS = tmpS;
                } else if (tmpH == cntH && tmpS < cntS) {
                    pos = left;
                    cntS = tmpS;
                }
            }
            right++;
        }

        System.out.println(pos);
    }
}
